import { createRouter, createWebHistory } from 'vue-router'
import Login from '../views/Login.vue'
import Home from '../views/Home.vue'

const routes = [
	{
		path: '/',
		name: 'login',
		component: Login,
	},
	{
		path: '/home',
		name: 'home',
		component: Home,
		children: [
			{
				id: 1,
				label: '会员管理',
				iconCls: 'el-icon-user',
				path: '/main_user',
				meta: { title: '会员管理', requireAuth: true },
				children: [
					{
						id: 2,
						label: '会员列表',
						iconCls: 'el-icon-user',
						path: '/user/list',
						meta: { title: '会员列表', requireAuth: false },
						component:()=>import('@/views/platform/user/list.vue')
					},
					{
						id: 3,
						label: '添加会员',
						iconCls: 'el-icon-user-solid',
						path: '/user/add',
						meta: { title: '添加会员', requireAuth: false },
						component:()=>import('@/views/platform/user/add.vue')
					},
				],
			},
			{
				id: 17,
				label: 'banner管理',
				iconCls: 'el-icon-office-building',
				path: '/main_banner',
				meta: { title: 'banner管理', requireAuth: true },
				children: [
					{
						id: 19,
						label: 'Banner添加',
						iconCls: 'el-icon-edit',
						path: '/banner/add',
						name:'addbanner',
						meta: { title: 'Banner添加', requireAuth: false },
						component:()=>import('@/views/platform/banner/add.vue')
					},
					{
						id: 18,
						label: 'Banner列表',
						iconCls: 'el-icon-box',
						path: '/banner/list',
						meta: { title: 'Banner列表', requireAuth: false },
						component:()=>import('@/views/platform/banner/list.vue')
					},
				],
			},
			{
				id: 20,
				label: '商品模块',
				iconCls: 'el-icon-goods',
				path: '/main_shop',
				meta: { title: '商品模块', requireAuth: true },
				children: [
					{
						id: 21,
						label: '商品列表',
						iconCls: 'el-icon-s-order',
						path: '/shop//list',
						meta: { title: '商品列表', requireAuth: false },
					},
					{
						id: 22,
						label: '商品添加',
						iconCls: 'el-icon-s-cooperation',
						path: '/shop/add',
						meta: { title: '商品添加', requireAuth: false },
					},
				],
			},
			{
				id: 23,
				label: '商品分类',
				iconCls: 'el-icon-s-cooperation\r\nel-icon-camera',
				path: '/main_category',
				meta: { title: '商品分类', requireAuth: true },
				children: [
					{
						id: 24,
						label: '分类列表',
						iconCls: 'el-icon-edit',
						path: '/category/list',
						meta: { title: '分类列表', requireAuth: false },
					},
					{
						id: 25,
						label: '添加分类',
						iconCls: 'el-icon-box',
						path: '/category/add',
						meta: { title: '添加分类', requireAuth: false },
					},
				],
			},
			{
				id: 7,
				label: '日志管理',
				iconCls: 'el-icon-help',
				path: '/main_log',
				meta: { title: '日志管理', requireAuth: true },
				children: [
					{
						id: 9,
						label: '添加日志',
						iconCls: 'el-icon-s-data',
						path: '/log/add',
						meta: { title: '添加日志', requireAuth: false },
						component:()=>import('@/views/platform/log/add.vue')
					},
					{
						id: 8,
						label: '日志列表',
						iconCls: 'el-icon-s-claim',
						path: '/log/list',
						meta: { title: '日志列表', requireAuth: false },
						component:()=>import('@/views/platform/log/list.vue')
					},
				],
			},
		],
	},
]

const router = createRouter({
	history: createWebHistory(),
	routes,
})

export default router
